package neo.tetris;

import java.io.IOException;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import neo.sourceEngine.network.adapter.ws.WebSocketAdapter;
import neo.sourceEngine.network.rpc.service.ServiceCache;
import neo.tetris.rpc.session.SessionModel;

public class TetrisServer implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		try {
			WebSocketAdapter.clazz = SessionModel.class;
			ServiceCache.loadServices("neo.tetris.rpc.service");
		} catch (ClassNotFoundException | IOException | InstantiationException | IllegalAccessException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {

	}
}
